package com.yellowcong.web.kanman;

import java.util.concurrent.BlockingQueue;

import com.yellowcong.http.utils.KanmanUtils;
import com.yellowcong.kanman.dto.Chapter;


/**
*
*作者:yellowcong
*日期:2017/11/24
*時間:10:09:13
*描述:
*/
public class PageThread implements Runnable{
    private BlockingQueue<Chapter> queue ;

    public PageThread(BlockingQueue<Chapter> queue) {
        super();
        this.queue = queue;
    }

    public void run() {
        try {
            while(this.queue.size()>0) {
                //获取后，进行下载
            	Chapter chapter = this.queue.take();
            	
            	//下载数据
            	KanmanUtils.downloadChapter(chapter);
            }
        } catch (InterruptedException e) {
            e.printStackTrace();
        }
    }

}